<?php

require_once($cfgPaths['lib']."cms/isParser.o.inc.php");

class TplParser extends isParser
{
	var $null;
	var $cdata;
	var $tpldata;

  function TplParser (&$tpldata)
  {
    $this->tpldata = &$tpldata;
  }

  function startElement($parser, $name, $attrs)
  {
    if ($name=='IS:SEPARATOR')
    {
       $this->cdata = &$this->tpldata[strtolower($attrs['POS'])];
    }
    elseif ($name=='IS:FORMITEM')
    {
       $this->cdata = &$this->tpldata['item'][strtolower($attrs['STATE'])];
    }
  }

  function finitElement($parser, $name, $attrs)
  {
    if ($name=='IS:CONF')
    {
       $this->tpldata['attrs'] = $attrs;
    }
  }

  function endElement($parser, $name)
  {
     $this->cdata = &$this->null;
  }

  function cData($parser, $data)
  {
     $this->cdata .= $data;
  }

}

?>